package com.ruoyi.process.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.process.domain.workflow.ApprParam;
import com.ruoyi.process.service.IFlowTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 流程任务的操作
 */
@RestController
@RequestMapping("/workflow/flowTask")
public class FlowTaskController {
    @Autowired
    private IFlowTaskService flowTaskService;
    //操作选项目
    /**
     * 审批同意
     */
    @PostMapping("/agree")
    public AjaxResult agree(@RequestBody ApprParam params) {
        flowTaskService.agree(params);
        return AjaxResult.success();
    }

    /**
     * 审批拒绝
     */
    @PostMapping("/refuse")
    public AjaxResult refuse(@RequestBody ApprParam params) {
        flowTaskService.refuse(params);
        return AjaxResult.success();
    }

    /**
     * 审批转办
     */
    @PostMapping("/transfer")
    public AjaxResult transfer(@RequestBody ApprParam params) {
        flowTaskService.transfer(params);
        return AjaxResult.success();
    }

    /**
     * 审批委派
     */
    @PostMapping("/delegate")
    public AjaxResult delegate(@RequestBody ApprParam params) {
        flowTaskService.delegate(params);
        return AjaxResult.success();
    }

    /**
     * 加签
     * @param params
     * @return
     */


    @GetMapping(value = "/addsignlabel")
    public AjaxResult addsignlabel(ApprParam params) {
        flowTaskService.addsigntask(params);
        return AjaxResult.success("加签成功");
    }
//   查询选项



}
